;;; -*- Mode:LISP; Package:USER; Readtable:CL; Base:10 -*-

(defun package-data (&optional (package-list (list-all-packages)))
  (dolist (p (pkg-list-sort package-list))
    (format t "~%Name: ~a~@[ [~{~a~^ ~}]~]~
               ~@[~%  Uses:    ~~{~<~%~1,80:;~a~;~>~^ ~}~~]~
               ~@[~%  Used By: ~~{~<~%~1,80:;~a~;~>~^ ~}~~]"
            (package-name p) (sort (package-nicknames p) #'string<)
            (mapcar #'package-name (pkg-list-sort (package-use-list p)))
            (mapcar #'package-name (pkg-list-sort (package-used-by-list p))))))

(defun pkg-list-sort (packages)
  (sort packages #'(lambda (x y)
                     (string< (package-name x) (package-name y)))))

#|

GigaMos Lambda Release 4.0, band 1 of alex harpo. ((make-k-system) 7/19/88 17:57 pfc)
4060K physical memory, 20000K virtual memory, NuBus slot 4.
 System         125.19
 ZWEI           125.3
 ZMail           73.0
 Local-File      75.0
 File-Server     24.0
 Unix-Interface  13.0
 Tape            24.2
 Lambda-Diag     17.0
 Microcode     1761
 SDU              3.12
LMI Harpo, with associated machine DJ.

Name: ANSI
  Uses:    GLOBAL
Name: AREA-DATA
  Uses:    MEMORY-MANAGEMENT PRIMITIVES REGION-DATA VINCULUM
Name: ARP
  Uses:    LISP NETWORK
Name: ARRAY
  Uses:    K PRIMITIVES VINCULUM
Name: BOOT
  Uses:    K PRIMITIVES VINCULUM VIRTUAL-MEMORY
Name: CADR [CC]
  Uses:    GLOBAL SYSTEM
Name: CHAOS
  Uses:    GLOBAL SYSTEM
Name: CLI
Name: COLD
  Uses:    K LISP
Name: COLOR
  Uses:    GLOBAL SYSTEM
Name: COMPILER
  Uses:    GLOBAL SYSTEM
Name: CONS
  Uses:    K MEMORY-MANAGEMENT-INTERFACE PRIMITIVES VINCULUM
  Used By: SYMBOL
Name: DATATYPE-RAM [DT-RAM]
  Uses:    K PRIMITIVES VINCULUM
Name: DUMPIT
  Uses:    GLOBAL LISP
Name: EH [DBG DEBUGGER]
  Uses:    GLOBAL SYSTEM
Name: ETHERNET
  Uses:    LISP NETWORK
Name: FASDUMP
  Uses:    LISP
Name: FED
  Uses:    GLOBAL SYSTEM
Name: FILE-SYSTEM [FS]
  Uses:    GLOBAL SYSTEM
Name: FONTS
Name: FORMAT
  Uses:    GLOBAL
Name: FTP
  Uses:    INTERNET LISP NETWORK TCP TCP-APPLICATION
Name: GARBAGE-COLLECTOR [GC]
  Uses:    GLOBAL SYSTEM SYSTEM-INTERNALS
Name: GC-FAULT
  Uses:    MAP PRIMITIVES VINCULUM
Name: GC-RAM
  Uses:    PRIMITIVES VINCULUM
Name: GLOBAL [ZETALISP ZL]
  Used By: ANSI CADR CHAOS COLOR COMPILER DUMPIT EH FED FILE-SYSTEM
           FORMAT GARBAGE-COLLECTOR HACKS K-DIAG LAMBDA MATH METER
           MICRO-ASSEMBLER NETWORK-USER PRESS QFASL-REL QUOTE SDU
           SRCCOM SUPDUP SYSTEM SYSTEM-INTERNALS TAPE TFRAME TIME TM
           TOPS20 TV UNIX USER ZWEI
Name: GLOBAL-REGISTERS [GR]
  Uses:    PRIMITIVES
Name: HACKS
  Uses:    GLOBAL
Name: HARDWARE [HW]
Name: ICMP
  Uses:    INTERNET LISP NETWORK
Name: INTERNET [IP]
  Uses:    LISP NETWORK
  Used By: FTP ICMP TCP TCP-APPLICATION TELNET UDP
Name: K
  Used By: K2 KBUG KBUG-STREAMS LISP-INTERNALS NEW-MATH NUBUS-STUFF
           TRAP
Name: K-AREA-DATA
  Uses:    K-MEMORY-MANAGEMENT K-PRIMITIVES K-REGION-DATA K-VINCULUM
Name: K-ARRAY
  Uses:    K-K K-PRIMITIVES K-VINCULUM
Name: K-BOOT
  Uses:    K-K K-PRIMITIVES K-VINCULUM K-VIRTUAL-MEMORY
Name: K-COLD
  Uses:    K-K LISP
Name: K-CONS
  Uses:    K-K K-MEMORY-MANAGEMENT-INTERFACE K-PRIMITIVES K-VINCULUM
  Used By: K-SYMBOL
Name: K-DATATYPE-RAM [K-DT-RAM]
  Uses:    K-K K-PRIMITIVES K-VINCULUM
Name: K-DEBUG
  Uses:    K PRIMITIVES VINCULUM
Name: K-DIAG
  Uses:    GLOBAL
Name: K-FASDUMP
  Uses:    LISP
Name: K-GC-FAULT
  Uses:    K-MAP K-PRIMITIVES K-VINCULUM
Name: K-GC-RAM
  Uses:    K-PRIMITIVES K-VINCULUM
Name: K-GLOBAL
  Used By: K-USER
Name: K-GLOBAL-REGISTERS [K-GR]
  Uses:    K-PRIMITIVES
Name: K-HARDWARE [K-HW]
Name: K-K
  Used By: K-K2 K-KBUG K-KBUG-STREAMS K-LISP-INTERNALS K-NEW-MATH
           K-NUBUS-STUFF K-TRAP
Name: K-K-DEBUG
  Uses:    K-K K-PRIMITIVES K-VINCULUM
Name: K-K2
  Uses:    K-K K-KBUG-STREAMS K-PRIMITIVES K-VINCULUM
Name: K-KBUG
  Uses:    K-K LAMBDA LISP
Name: K-KBUG-STREAMS
  Uses:    K-K K-PRIMITIVES K-VINCULUM
  Used By: K-K2
Name: K-LISP-INTERNALS [K-LI]
  Uses:    K-K K-PRIMITIVES
Name: K-MAP
  Uses:    K-PRIMITIVES K-VINCULUM
  Used By: K-GC-FAULT K-MAP-FAULT
Name: K-MAP-FAULT
  Uses:    K-MAP K-PHYSICAL-CLUSTER-DATA K-PRIMITIVES K-VINCULUM
           K-VIRTUAL-MEMORY
Name: K-MEMORY-MANAGEMENT [K-MEMLOW]
  Uses:    K-PRIMITIVES K-VINCULUM
  Used By: K-AREA-DATA K-REGION-BITS K-REGION-DATA
Name: K-MEMORY-MANAGEMENT-INTERFACE [K-MEM]
  Uses:    K-PRIMITIVES K-VINCULUM
  Used By: K-CONS
Name: K-NEW-MATH
  Uses:    K-K K-PRIMITIVES K-VINCULUM
Name: K-NUBUS-STUFF
  Uses:    K-K K-PRIMITIVES K-VINCULUM
Name: K-PAGING-DEVICES
  Uses:    K-PRIMITIVES K-VINCULUM
Name: K-PHYSICAL-CLUSTER-DATA [K-PCD]
  Uses:    K-PRIMITIVES K-VINCULUM K-VIRTUAL-MEMORY
  Used By: K-MAP-FAULT
Name: K-PRIMITIVES [K-PRIMS]
  Used By: K-SYMBOL K-TIMERS K-TRANSPORTER-RAM K-TRAP K-VINCULUM
           K-VIRTUAL-MEMORY
Name: K-QUANTUM-MAP
  Uses:    K-PRIMITIVES K-VINCULUM K-VIRTUAL-MEMORY
Name: K-REGION-BITS
  Uses:    K-MEMORY-MANAGEMENT K-PRIMITIVES K-VINCULUM K-VIRTUAL-MEMORY
Name: K-REGION-DATA
  Uses:    K-MEMORY-MANAGEMENT K-PRIMITIVES K-VINCULUM
  Used By: K-AREA-DATA
Name: K-SETF
  Uses:    LISP
Name: K-SYMBOL
  Uses:    K-CONS K-PRIMITIVES K-VINCULUM
Name: K-TIMERS
  Uses:    K-PRIMITIVES K-VINCULUM
Name: K-TRANSPORTER-RAM
  Uses:    K-PRIMITIVES K-VINCULUM K-VIRTUAL-MEMORY
Name: K-TRAP
  Uses:    K-K K-PRIMITIVES K-VINCULUM
Name: K-USER
  Uses:    K-GLOBAL
Name: K-VINCULUM [K-VINC]
  Uses:    K-PRIMITIVES
  Used By: K-SYMBOL K-TIMERS K-TRANSPORTER-RAM K-TRAP K-VIRTUAL-MEMORY
Name: K-VIRTUAL-MEMORY [K-VMEM]
  Uses:    K-PRIMITIVES K-VINCULUM
  Used By: K-BOOT K-MAP-FAULT K-PHYSICAL-CLUSTER-DATA K-QUANTUM-MAP
           K-REGION-BITS K-TRANSPORTER-RAM
Name: K2
  Uses:    K KBUG-STREAMS PRIMITIVES VINCULUM
Name: KBUG
  Uses:    K LAMBDA LISP
Name: KBUG-STREAMS
  Uses:    K PRIMITIVES VINCULUM
  Used By: K2
Name: KEYWORD []
Name: LAMBDA [LAM]
  Uses:    GLOBAL
  Used By: K-KBUG KBUG
Name: LISP [CL COMMON-LISP]
  Used By: K-FASDUMP K-KBUG K-SETF KBUG NC NETWORK SETF TAG TCP
           TCP-APPLICATION TELNET UDP
Name: LISP-INTERNALS [LI]
  Uses:    K PRIMITIVES
Name: MAP
  Uses:    PRIMITIVES VINCULUM
  Used By: GC-FAULT MAP-FAULT
Name: MAP-FAULT
  Uses:    MAP PHYSICAL-CLUSTER-DATA PRIMITIVES VINCULUM VIRTUAL-MEMORY
Name: MATH
  Uses:    GLOBAL
Name: MEMORY-MANAGEMENT [MEMLOW]
  Uses:    PRIMITIVES VINCULUM
  Used By: AREA-DATA REGION-BITS REGION-DATA
Name: MEMORY-MANAGEMENT-INTERFACE [MEM]
  Uses:    PRIMITIVES VINCULUM
  Used By: CONS
Name: METER
  Uses:    GLOBAL SYSTEM
Name: MICRO-ASSEMBLER [UA]
  Uses:    GLOBAL
Name: NC
  Uses:    LISP
Name: NETWORK [NET]
  Uses:    LISP
  Used By: ARP ETHERNET FTP ICMP INTERNET TCP TCP-APPLICATION TELNET
           UDP
Name: NETWORK-USER
  Uses:    GLOBAL
Name: NEW-MATH
  Uses:    K PRIMITIVES VINCULUM
Name: NLISP
  Uses:    PRIMITIVES
Name: NUBUS-STUFF
  Uses:    K PRIMITIVES VINCULUM
Name: PAGING-DEVICES
  Uses:    PRIMITIVES VINCULUM
Name: PHYSICAL-CLUSTER-DATA [PCD]
  Uses:    PRIMITIVES VINCULUM VIRTUAL-MEMORY
  Used By: MAP-FAULT
Name: PRESS
  Uses:    GLOBAL
Name: PRIMITIVES [PRIMS]
  Used By: K2 KBUG-STREAMS LISP-INTERNALS MAP MAP-FAULT
           MEMORY-MANAGEMENT MEMORY-MANAGEMENT-INTERFACE NEW-MATH NLISP
           NUBUS-STUFF PAGING-DEVICES PHYSICAL-CLUSTER-DATA QUANTUM-MAP
           REGION-BITS REGION-DATA SYMBOL TIMERS TRANSPORTER-RAM TRAP
           VINCULUM VIRTUAL-MEMORY
Name: QFASL-REL
  Uses:    GLOBAL SYSTEM
Name: QUANTUM-MAP
  Uses:    PRIMITIVES VINCULUM VIRTUAL-MEMORY
Name: QUOTE
  Uses:    GLOBAL
Name: REGION-BITS
  Uses:    MEMORY-MANAGEMENT PRIMITIVES VINCULUM VIRTUAL-MEMORY
Name: REGION-DATA
  Uses:    MEMORY-MANAGEMENT PRIMITIVES VINCULUM
  Used By: AREA-DATA
Name: SDU
  Uses:    GLOBAL
Name: SETF
  Uses:    LISP
Name: SRCCOM
  Uses:    GLOBAL
Name: SUPDUP
  Uses:    GLOBAL
Name: SYMBOL
  Uses:    CONS PRIMITIVES VINCULUM
Name: SYSTEM [SYS]
  Uses:    GLOBAL
  Used By: CADR CHAOS COLOR COMPILER EH FED FILE-SYSTEM
           GARBAGE-COLLECTOR METER QFASL-REL SYSTEM-INTERNALS TV
Name: SYSTEM-INTERNALS [SI]
  Uses:    GLOBAL SYSTEM
  Used By: GARBAGE-COLLECTOR
Name: TAG
  Uses:    LISP
Name: TAPE
  Uses:    GLOBAL
Name: TCP
  Uses:    INTERNET LISP NETWORK
  Used By: FTP TCP-APPLICATION TELNET
Name: TCP-APPLICATION [TCPA]
  Uses:    INTERNET LISP NETWORK TCP
  Used By: FTP TELNET
Name: TELNET
  Uses:    INTERNET LISP NETWORK TCP TCP-APPLICATION
Name: TFRAME
  Uses:    GLOBAL
Name: TIME
  Uses:    GLOBAL
Name: TIMERS
  Uses:    PRIMITIVES VINCULUM
Name: TLPCP
Name: TM
  Uses:    GLOBAL
Name: TOPS20
  Uses:    GLOBAL
Name: TRANSPORTER-RAM
  Uses:    PRIMITIVES VINCULUM VIRTUAL-MEMORY
Name: TRAP
  Uses:    K PRIMITIVES VINCULUM
Name: TV
  Uses:    GLOBAL SYSTEM
Name: UDP
  Uses:    INTERNET LISP NETWORK
Name: UNIX
  Uses:    GLOBAL
Name: USER
  Uses:    GLOBAL
Name: VINCULUM [VINC]
  Uses:    PRIMITIVES
  Used By: K2 KBUG-STREAMS MAP MAP-FAULT MEMORY-MANAGEMENT
           MEMORY-MANAGEMENT-INTERFACE NEW-MATH NUBUS-STUFF
           PAGING-DEVICES PHYSICAL-CLUSTER-DATA QUANTUM-MAP REGION-BITS
           REGION-DATA SYMBOL TIMERS TRANSPORTER-RAM TRAP
           VIRTUAL-MEMORY
Name: VIRTUAL-MEMORY [VMEM]
  Uses:    PRIMITIVES VINCULUM
  Used By: BOOT MAP-FAULT PHYSICAL-CLUSTER-DATA QUANTUM-MAP REGION-BITS
           TRANSPORTER-RAM
Name: ZLI
Name: ZWEI
  Uses:    GLOBAL
Name: ZWEI Utility Package

|#
